package com.train.implementRunnable;
/**
 * 运行
 * */
public class RunThread {
    public static void main(String[] args) {
        ImplementRunnable runnable_1 = new ImplementRunnable();
        // 相当于将一个类实体的方法分布在多个线程中执行。
        ThreadGroup threadGroup = new ThreadGroup("thread_group_a");
        Thread thread_1 = new Thread(threadGroup,runnable_1,"runnable_1");
        Thread thread_2 = new Thread(threadGroup,runnable_1,"runnable_2");
        Thread thread_3 = new Thread(threadGroup,runnable_1,"runnable_3");
        Thread thread_4 = new Thread(threadGroup,runnable_1,"runnable_4");
        // 创建一个实现了Runnable接口的类实例
        thread_1.start();
        thread_2.start();
        thread_3.start();
        thread_4.start();
    }
}